package com.example.easyrulesimple.word;

import com.deepoove.poi.XWPFTemplate;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;

/**
 * 作者：liyuan
 * 时间：2024/5/22 18:04
 * 描述：
 **/
public class Test1 {
    public static void main(String[] args) throws IOException {
        File file = new File("");
        System.out.println(file.getAbsolutePath());
        XWPFTemplate template = XWPFTemplate.compile("template.docx").render(
                new HashMap<String, Object>(){{
                    put("title", "Hi, poi-tl Word模板引擎");
                }});
        template.writeAndClose(new FileOutputStream("output.docx"));
    }
}
